home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / sys / sysUnixSyscall.c < prev   
Encoding:
C/C++ Source or Header  |  1991-08-09  |  18.8 KB  |  411 lines

  1. /* 
  2.  * _Syscall.c --
  3.  *
  4.  *    Table of Unix compatible system calls.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef lint
  17. static char rcsid[] = "$Header: /sprite/src/kernel/sys/RCS/sysUnixSyscall.c,v 1.6 91/08/09 14:56:19 shirriff Exp $";
  18. #endif /* not lint */
  19.  
  20. #include <sprite.h>
  21. #include <vmUnixStubs.h>
  22. #include <fsUnixStubs.h>
  23. #include <proc.h>
  24. #include <procUnixStubs.h>
  25. #include <vm.h>
  26. #include <sig.h>
  27. #include <sigUnixStubs.h>
  28. #include <sys.h>
  29. #include <sysInt.h>
  30. #include <timerUnixStubs.h>
  31. #include <mach.h>
  32. #include <stdio.h>
  33.  
  34.  
  35. #define SYS_UNIX_ERROR  Sys_UnixError
  36.  
  37. static int Sys_UnixError _ARGS_((void));
  38. static int Sys_TestStub _ARGS_((int arg0, int arg1, int arg2, int arg3,
  39.     int arg4, int arg5));
  40.  
  41. /*
  42.  * The system call table.
  43.  * Note: from call #150 on, the calls are different between mips and sunOS.
  44.  */
  45.  
  46. /*
  47.  * Warning: if a system call with more than 6 arguments is added,
  48.  * sun4.md/machTrap.s will have to be modified to fetch the arguments,
  49.  * since only 6 arguments are passed in registers.
  50.  */
  51.  
  52. unixSyscallEntry sysUnixSysCallTable[258] = {
  53.     {  SYS_UNIX_ERROR,        0  },      /* indir  */
  54.     { Proc_ExitStub,          1  },      /* exit  */
  55.     { Proc_ForkStub,          0  },      /* fork  */
  56.     { Fs_NewReadStub,         3  },      /* read  */
  57.     { Fs_NewWriteStub,        3  },      /* write  */
  58.     { Fs_NewOpenStub,         3  },      /* open  */
  59.     { Fs_NewCloseStub,        1  },      /* close  */
  60. #if defined(ds3100) || defined(ds5000)
  61.     { SYS_UNIX_ERROR,         0  },      /* old wait  */
  62. #else
  63.     { Proc_Wait4Stub,         4  },      /* wait4  */
  64. #endif
  65.     { Fs_CreatStub,           2  },      /* creat  */
  66.     { Fs_LinkStub,            2  },      /* link  */    
  67.     { Fs_UnlinkStub,          1  },      /* unlink  */
  68.     { Proc_ExecvStub,         2  },      /* execv  */
  69.     { Fs_ChdirStub,           1  },      /* chdir  */
  70.     { SYS_UNIX_ERROR,         0  },      /* old time  */
  71.     { SYS_UNIX_ERROR,         3  },      /* mknod  */
  72.     { Fs_ChmodStub,           2  },      /* chmod  */
  73.     { Fs_ChownStub,           3  },      /* chown  */ 
  74.     { Vm_SbrkStub,            1  },      /* sbrk  */
  75.     { SYS_UNIX_ERROR,         2  },      /* old stat  */
  76.     { Fs_LseekStub,           3  },      /* lseek  */
  77.     { Proc_GetpidStub,        0  },      /* getpid  */
  78.     { SYS_UNIX_ERROR,         5  },      /* mount  */
  79.     { SYS_UNIX_ERROR,         1  },      /* umount  */
  80.     { SYS_UNIX_ERROR,         1  },      /* old setuid  */
  81.     { Proc_GetuidStub,        0  },      /* getuid  */
  82.     { SYS_UNIX_ERROR,         1  },      /* old stime  */
  83.     { Proc_PtraceStub,        4  },      /* ptrace  */
  84.     { SYS_UNIX_ERROR,         1  },      /* old alarm  */
  85.     { SYS_UNIX_ERROR,         2  },      /* old fstat  */
  86.     { SYS_UNIX_ERROR,         0  },      /* old pause  */
  87.     { SYS_UNIX_ERROR,         2  },      /* old utime  */
  88.     { SYS_UNIX_ERROR,         0  },      /* old stty  */
  89.     { SYS_UNIX_ERROR,         0  },      /* old gtty  */
  90.     { Fs_AccessStub,          2  },      /* access  */
  91.     { SYS_UNIX_ERROR,         1  },      /* old nice  */
  92.     { SYS_UNIX_ERROR,         1  },      /* old ftime  */
  93.     { Fs_SyncStub,            0  },      /* sync  */
  94.     { Sig_KillStub,          2  },      /* kill  */
  95.     { Fs_StatStub,            2  },      /* stat  */
  96.     { SYS_UNIX_ERROR,         2  },      /* old setpgrp  */
  97.     { Fs_LstatStub,           2  },      /* lstat  */
  98.     { Fs_DupStub,             1  },      /* dup  */
  99.     { Fs_PipeStub,            1  },      /* pipe  */
  100.     { SYS_UNIX_ERROR,         1  },      /* old times  */
  101.     { SYS_UNIX_ERROR,         4  },      /* profil  */
  102.     { SYS_UNIX_ERROR,         0  },      /* nosys  */
  103.     { SYS_UNIX_ERROR,         1  },      /* old setgid  */
  104.     { Proc_GetgidStub,        0  },      /* getgid  */
  105.     { SYS_UNIX_ERROR,         2  },      /* old sig  */
  106.     { SYS_UNIX_ERROR,         0  },      /* USG 1  */
  107.     { SYS_UNIX_ERROR,         0  },      /* USG 2  #50 */
  108.     { SYS_UNIX_ERROR,         1  },      /* acct  */
  109.     { SYS_UNIX_ERROR,         0  },      /* old set phys addr  */
  110.     { SYS_UNIX_ERROR,         0  },      /* old syslock in core  */
  111.     { Fs_IoctlStub,           3  },      /* ioctl  */
  112.     { Sys_RebootStub,         1  },      /* reboot  */
  113.     { SYS_UNIX_ERROR,         0  },      /* old mpxchan  */
  114.     { Fs_SymlinkStub,         2  },      /* symlink  */
  115.     { Fs_ReadlinkStub,        3  },      /* readlink  */
  116.     { Proc_ExecveStub,        3  },      /* execve  */
  117.     { Proc_UmaskStub,         1  },      /* umask  #60 */
  118.     { SYS_UNIX_ERROR,         1  },      /* chroot  */
  119.     { Fs_FstatStub,           2  },      /* fstat  */
  120.     { SYS_UNIX_ERROR,         0  },      /* used internally  */
  121.     { Vm_GetpagesizeStub,     0  },      /* getpagesize  */
  122.     { SYS_UNIX_ERROR,         5  },      /* mremap  */
  123.     { Proc_VforkStub,         0  },      /* vfork  */
  124.     { SYS_UNIX_ERROR,         0  },      /* old vread  */
  125.     { SYS_UNIX_ERROR,         0  },      /* old vwrite  */
  126.     { SYS_UNIX_ERROR,         1  },      /* new sbrk  */
  127.     { SYS_UNIX_ERROR,         1  },      /* sstk #70 */
  128.     { Vm_MmapStub,            6  },      /* mmap  */
  129.     { Sys_NopStub,            1  },      /* old vadvise  */
  130.     { Vm_MunmapStub,          2  },      /* munmap  */
  131.     { Vm_MprotectStub,        3  },      /* mprotect  */
  132.     { SYS_UNIX_ERROR,         3  },      /* madvise  */
  133.     { SYS_UNIX_ERROR,         1  },      /* vhangup  */
  134.     { SYS_UNIX_ERROR,         2  },      /* old vlimit  */
  135.     { Vm_MincoreStub,         3  },      /* mincore  */
  136.     { Proc_GetgroupsStub,     2  },      /* getgroups  */
  137.     { Proc_SetgroupsStub,     2  },      /* setgroups  #80 */
  138.     { Proc_GetpgrpStub,       1  },      /* getpgrp  */
  139.     { Proc_SetpgrpStub,       2  },      /* setpgrp  */
  140.     { Proc_SetitimerStub,     3  },      /* setitimer  */
  141.     { Proc_Wait3Stub,         3  },      /* wait3  */
  142.     { SYS_UNIX_ERROR,         1  },      /* swapon  */
  143.     { Proc_GetitimerStub,     2  },      /* getitimer  */
  144.     { Sys_GethostnameStub,    2  },      /* gethostname  */
  145.     { Sys_SethostnameStub,    2  },      /* sethostname  */
  146.     { Fs_GetdtablesizeStub,   0  },      /* getdtablesize  */
  147.     { Fs_Dup2Stub,            2  },      /* dup2  #90 */
  148.     { Fs_GetdoptStub,         2  },      /* getdopt  */
  149.     { Fs_FcntlStub,           3  },      /* fcntl  */
  150.     { Fs_NewSelectStub,       5  },      /* select  */
  151.     { Fs_SetdoptStub,         2  },      /* setdopt  */
  152.     { Fs_FsyncStub,           1  },      /* fsync  */
  153.     { Proc_SetpriorityStub,   3  },      /* setpriority  */
  154.     { Fs_SocketStub,          3  },      /* socket  */
  155.     { Fs_ConnectStub,         3  },      /* connect  */
  156.     { Fs_AcceptStub,          3  },      /* accept  */
  157.     { Proc_GetpriorityStub,   2  },      /* getpriority  #100 */
  158.     { Fs_SendStub,            4  },      /* send  */
  159.     { Fs_RecvStub,            4  },      /* recv  */
  160. #if defined(ds3100) || defined(ds5000)
  161.     { Mach_SigreturnStub,      1  },      /* sigreturn */
  162. #else
  163.     { SYS_UNIX_ERROR,         0  },      /* old socketaddr (103) */
  164. #endif
  165.     { Fs_BindStub,            3  },      /* bind  */
  166.     { Fs_SetsockoptStub,      5  },      /* setsockopt  */
  167.     { Fs_ListenStub,          2  },      /* listen  */
  168.     { SYS_UNIX_ERROR,         2  },      /* old vtimes  */
  169.     { Sig_SigvecStub,         4  },      /* sigvec  */
  170.     { Sig_SigblockStub,       1  },      /* sigblock  */
  171.     { Sig_SigsetmaskStub,     1  },      /* sigsetmask  #110 */
  172.     { Sig_SigpauseStub,       1  },      /* sigpause  */
  173.     { Sig_SigstackStub,       2  },      /* sigstack  */
  174.     { Fs_RecvmsgStub,         3  },      /* recvmsg  */
  175.     { Fs_SendmsgStub,         3  },      /* sendmsg  */
  176.     { SYS_UNIX_ERROR,         0  },      /* #115  */
  177.     { Timer_GettimeofdayStub, 2  },      /* gettimeofday  */
  178.     { Proc_GetrusageStub,     2  },      /* getrusage  */
  179.     { Fs_GetsockoptStub,      5  },      /* getsockopt  */
  180.     { SYS_UNIX_ERROR,         0  },      /* #119  */
  181.     { Fs_ReadvStub,           3  },      /* readv  #120 */
  182.     { Fs_WritevStub,          3  },      /* writev  */
  183.     { Timer_SettimeofdayStub, 2  },      /* settimeofday  */
  184.     { Fs_FchownStub,          3  },      /* fchown  */
  185.     { Fs_FchmodStub,          2  },      /* fchmod  */
  186.     { Fs_RecvfromStub,        6  },      /* recvfrom  */
  187.     { Proc_SetreuidStub,      2  },      /* setreuid  */
  188.     { Proc_SetregidStub,      2  },      /* setregid  */
  189.     { Fs_NewRenameStub,       2  },      /* rename  */
  190.     { Fs_TruncateStub,        2  },      /* truncate  */
  191.     { Fs_FtruncateStub,       2  },      /* ftruncate  #130 */
  192.     { Fs_FlockStub,           2  },      /* flock  */
  193.     { SYS_UNIX_ERROR,         0  },      /* #132  */
  194.     { Fs_SendtoStub,          6  },      /* sendto  */
  195.     { Sys_ShutdownStub,       2  },      /* shutdown  */
  196.     { Fs_SocketpairStub,      5  },      /* socketpair  */
  197.     { Fs_MkdirStub,           2  },      /* mkdir  */
  198.     { Fs_RmdirStub,           1  },      /* rmdir  */
  199.     { Fs_UtimesStub,          2  },      /* utimes  */
  200. #if defined(ds3100) || defined(ds5000)
  201.     { SYS_UNIX_ERROR,         1  },      /*  #139  */
  202. #else
  203.     { Mach_SigreturnStub,      1  },      /* sigreturn (from longjmp) */
  204. #endif
  205.     { Timer_AdjtimeStub,      2  },      /* adjtime  #140 */
  206.     { Sys_GetpeernameStub,    3  },      /* getpeername  */
  207.     { Sys_GethostidStub,      2  },      /* gethostid  */
  208.     { Sys_SethostidStub,      2  },      /* sethostid  */
  209.     { Sys_GetrlimitStub,      2  },      /* getrlimit  */
  210.     { Sys_SetrlimitStub,      2  },      /* setrlimit  */
  211.     { Sig_KillpgStub,         2  },      /* killpg  */
  212.     { SYS_UNIX_ERROR,         0  },      /* #147  */
  213.     { SYS_UNIX_ERROR,         0  },      /* setquota  */
  214.     { SYS_UNIX_ERROR,         0  },      /* quota  */
  215.     { Fs_GetsocknameStub,     3  },      /* getsockname  #150 */    
  216. #if defined(ds3100) || defined(ds5000)
  217.     { SYS_UNIX_ERROR,         0  },      /* sysmips #151 */
  218.     { SYS_UNIX_ERROR,         0  },      /* cacheflush  */
  219.     { SYS_UNIX_ERROR,         0  },      /* cachectl  */
  220.     { SYS_UNIX_ERROR,         0  },      /* debug  */
  221.     { SYS_UNIX_ERROR,         0  },      /* #155  */
  222.     { SYS_UNIX_ERROR,         0  },      /* #156  */
  223.     { SYS_UNIX_ERROR,         0  },      /* #157  */
  224.     { SYS_UNIX_ERROR,         0  },      /* nfs_svc  */
  225.     { Fs_GetdirentriesStub,   4  },      /* getdirentries  */
  226.     { SYS_UNIX_ERROR,         0  },      /* statfs  #160 */
  227.     { SYS_UNIX_ERROR,         0  },      /* fstatfs  */
  228.     { SYS_UNIX_ERROR,         0  },      /* #162  */
  229.     { SYS_UNIX_ERROR,         0  },      /* #163  */
  230.     { SYS_UNIX_ERROR,         0  },      /* #164  */
  231.     { Sys_GetdomainnameStub,  2  },      /* getdomainname  */
  232.     { Sys_SetdomainnameStub,  2  },      /* setdomainname  */
  233.     { SYS_UNIX_ERROR,         0  },      /* #167  */
  234.     { SYS_UNIX_ERROR,         0  },      /* #168  */
  235.     { SYS_UNIX_ERROR,         0  },      /* exportfs  */
  236.     { SYS_UNIX_ERROR,         0  },      /* #170  */
  237.     { SYS_UNIX_ERROR,         0  },      /* #171  */
  238.     { SYS_UNIX_ERROR,         0  },      /* msgctl  */
  239.     { SYS_UNIX_ERROR,         0  },      /* msgget  */
  240.     { SYS_UNIX_ERROR,         0  },      /* msgrcv  */
  241.     { SYS_UNIX_ERROR,         0  },      /* msgsnd  */
  242.     { SYS_UNIX_ERROR,         0  },      /* semctl  */
  243.     { SYS_UNIX_ERROR,         0  },      /* semget  */
  244.     { SYS_UNIX_ERROR,         0  },      /* semop  */
  245.     { SYS_UNIX_ERROR,         0  },      /* uname  */
  246.     { SYS_UNIX_ERROR,         0  },      /* shmsys  #180 */
  247.     { SYS_UNIX_ERROR,         0  },      /* plock */
  248.     { SYS_UNIX_ERROR,         0  },      /* lockf  */
  249.     { SYS_UNIX_ERROR,         0  },      /* ustat  */
  250.     { SYS_UNIX_ERROR,         0  },      /* getmnt  */
  251.     { SYS_UNIX_ERROR,         0  },      /* mount  */
  252.     { SYS_UNIX_ERROR,         0  },      /* umount  */
  253.     { SYS_UNIX_ERROR,         0  },      /* sigpending  */
  254.     { SYS_UNIX_ERROR,         0  },      /* setsid  */
  255.     { Proc_WaitpidStub,     3  },      /* waitpid  */
  256. #else
  257.     { SYS_UNIX_ERROR,         0  },      /* getmsg  */
  258.     { SYS_UNIX_ERROR,         0  },      /* putmsg  */
  259.     { SYS_UNIX_ERROR,         0  },      /* poll  */
  260.     { SYS_UNIX_ERROR,         0  },      /* #154  */
  261.     { SYS_UNIX_ERROR,         0  },      /* nfs_svc  */
  262.     { Fs_GetdirentriesStub,   4  },      /* getdirentries  */
  263.     { SYS_UNIX_ERROR,         0  },      /* statfs  */
  264.     { SYS_UNIX_ERROR,         0  },      /* fstatfs  */
  265.     { SYS_UNIX_ERROR,         0  },      /* unmount  */
  266.     { SYS_UNIX_ERROR,         0  },      /* async_daemon #160 */
  267.     { SYS_UNIX_ERROR,         0  },      /* getfh  */
  268.     { Sys_GetdomainnameStub,  2  },      /* getdomainname  */
  269.     { Sys_SetdomainnameStub,  2  },      /* setdomainname  */
  270.     { SYS_UNIX_ERROR,         0  },      /* #164  */
  271.     { SYS_UNIX_ERROR,         0  },      /* quotactl  */
  272.     { SYS_UNIX_ERROR,         0  },      /* exportfs  */
  273.     { SYS_UNIX_ERROR,         0  },      /* mount  */
  274.     { SYS_UNIX_ERROR,         0  },      /* ustat  */
  275.     { SYS_UNIX_ERROR,         0  },      /* semsys  */
  276.     { SYS_UNIX_ERROR,         0  },      /* msgsys  #170 */
  277.     { SYS_UNIX_ERROR,         0  },      /* shmsys  */
  278.     { SYS_UNIX_ERROR,         0  },      /* auditsys  */
  279.     { SYS_UNIX_ERROR,         0  },      /* rfssys  */
  280.     { Fs_GetdentsStub,        3  },      /* getdents  */
  281.     { SYS_UNIX_ERROR,         0  },      /* setsid  */
  282.     { SYS_UNIX_ERROR,         0  },      /* fchdir  */
  283.     { SYS_UNIX_ERROR,         0  },      /* fchroot  */
  284.     { SYS_UNIX_ERROR,         0  },      /* vpixsys  */
  285.     { SYS_UNIX_ERROR,         0  },      /* aioread  */
  286.     { SYS_UNIX_ERROR,         0  },      /* aiowrite  #180 */
  287.     { SYS_UNIX_ERROR,         0  },      /* aiowait  */
  288.     { SYS_UNIX_ERROR,         0  },      /* aiocancel  */
  289.     { SYS_UNIX_ERROR,         0  },      /* sigpending  */
  290.     { SYS_UNIX_ERROR,         0  },      /* #184  */
  291.     { SYS_UNIX_ERROR,         0  },      /* setpgid  */
  292.     { SYS_UNIX_ERROR,         0  },      /* pathconf  */
  293.     { SYS_UNIX_ERROR,         0  },      /* fpathconf  */
  294.     { SYS_UNIX_ERROR,         0  },      /* sysconf  */
  295.     { SYS_UNIX_ERROR,         0  },      /* uname  */
  296. #endif
  297.     { SYS_UNIX_ERROR,         0  },      /* #190  */
  298.     { SYS_UNIX_ERROR,         0  },      /* #191  */
  299.     { SYS_UNIX_ERROR,         0  },      /* #192  */
  300.     { SYS_UNIX_ERROR,         0  },      /* #193  */
  301.     { SYS_UNIX_ERROR,         0  },      /* #194  */
  302.     { SYS_UNIX_ERROR,         0  },      /* #195  */
  303.     { SYS_UNIX_ERROR,         0  },      /* #196  */
  304.     { SYS_UNIX_ERROR,         0  },      /* #197  */
  305.     { SYS_UNIX_ERROR,         0  },      /* #198  */
  306.     { SYS_UNIX_ERROR,         0  },      /* #199  */
  307.     { SYS_UNIX_ERROR,         0  },      /* #200  */
  308.     { SYS_UNIX_ERROR,         0  },      /* #201  */
  309.     { SYS_UNIX_ERROR,         0  },      /* #202  */
  310.     { SYS_UNIX_ERROR,         0  },      /* #203  */
  311.     { SYS_UNIX_ERROR,         0  },      /* #204  */
  312.     { SYS_UNIX_ERROR,         0  },      /* #205  */
  313.     { SYS_UNIX_ERROR,         0  },      /* #206  */
  314.     { SYS_UNIX_ERROR,         0  },      /* #207  */
  315.     { SYS_UNIX_ERROR,         0  },      /* #208  */
  316.     { SYS_UNIX_ERROR,         0  },      /* #209  */
  317.     { SYS_UNIX_ERROR,         0  },      /* #210  */
  318.     { SYS_UNIX_ERROR,         0  },      /* #211  */
  319.     { SYS_UNIX_ERROR,         0  },      /* #212  */
  320.     { SYS_UNIX_ERROR,         0  },      /* #213  */
  321.     { SYS_UNIX_ERROR,         0  },      /* #214  */
  322.     { SYS_UNIX_ERROR,         0  },      /* #215  */
  323.     { SYS_UNIX_ERROR,         0  },      /* #216  */
  324.     { SYS_UNIX_ERROR,         0  },      /* #217  */
  325.     { SYS_UNIX_ERROR,         0  },      /* #218  */
  326.     { SYS_UNIX_ERROR,         0  },      /* #219  */
  327.     { SYS_UNIX_ERROR,         0  },      /* #220  */
  328.     { SYS_UNIX_ERROR,         0  },      /* #221  */
  329.     { SYS_UNIX_ERROR,         0  },      /* #222  */
  330.     { SYS_UNIX_ERROR,         0  },      /* #223  */
  331.     { SYS_UNIX_ERROR,         0  },      /* #224  */
  332.     { SYS_UNIX_ERROR,         0  },      /* #225  */
  333.     { SYS_UNIX_ERROR,         0  },      /* #226  */
  334.     { SYS_UNIX_ERROR,         0  },      /* #227  */
  335.     { SYS_UNIX_ERROR,         0  },      /* #228  */
  336.     { SYS_UNIX_ERROR,         0  },      /* #229  */
  337.     { SYS_UNIX_ERROR,         0  },      /* #230  */
  338.     { SYS_UNIX_ERROR,         0  },      /* #231  */
  339.     { SYS_UNIX_ERROR,         0  },      /* #232  */
  340.     { SYS_UNIX_ERROR,         0  },      /* #233  */
  341.     { SYS_UNIX_ERROR,         0  },      /* #234  */
  342.     { SYS_UNIX_ERROR,         0  },      /* #235  */
  343.     { SYS_UNIX_ERROR,         0  },      /* #236  */
  344.     { SYS_UNIX_ERROR,         0  },      /* #237  */
  345.     { SYS_UNIX_ERROR,         0  },      /* #238  */
  346.     { SYS_UNIX_ERROR,         0  },      /* #239  */
  347.     { SYS_UNIX_ERROR,         0  },      /* #240  */
  348.     { SYS_UNIX_ERROR,         0  },      /* #241  */
  349.     { SYS_UNIX_ERROR,         0  },      /* #242  */
  350.     { SYS_UNIX_ERROR,         0  },      /* #243  */
  351.     { SYS_UNIX_ERROR,         0  },      /* #244  */
  352.     { SYS_UNIX_ERROR,         0  },      /* #245  */
  353.     { SYS_UNIX_ERROR,         0  },      /* #246  */
  354.     { SYS_UNIX_ERROR,         0  },      /* #247  */
  355.     { SYS_UNIX_ERROR,         0  },      /* #248  */
  356.     { SYS_UNIX_ERROR,         0  },      /* #249  */
  357.     { SYS_UNIX_ERROR,         0  },      /* #250  */
  358.     { SYS_UNIX_ERROR,         0  },      /* #251  */
  359.     { SYS_UNIX_ERROR,         0  },      /* #252  */
  360.     { SYS_UNIX_ERROR,         0  },      /* #253  */
  361.     { SYS_UNIX_ERROR,         0  },      /* #254  */
  362.     { Sys_TestStub,           4  },      /* #255  */
  363.     { Sys_GetsysinfoStub,     0  },      /* getsysinfo  */
  364.     { SYS_UNIX_ERROR,         0  },      /* setsysinfo  */
  365. };
  366.  
  367. int sysUnixNumSyscalls =
  368.                 sizeof(sysUnixSysCallTable)/sizeof(*sysUnixSysCallTable);
  369.  
  370. #if defined(ds3100) || defined(ds5000)
  371. int sysCallNum;
  372. #endif
  373.  
  374. static int
  375. Sys_UnixError()
  376. {
  377.     extern Mach_State *machCurStatePtr;
  378.  
  379. #ifdef sun3
  380.     printf("Unix system call #%d is not implemented yet.\n",
  381.     machCurStatePtr->userState.lastSysCall);
  382. #endif
  383.  
  384. #ifdef sun4
  385.     printf("Unix system call #%d is not implemented yet.\n",
  386.     machCurStatePtr->lastSysCall);
  387. #endif
  388.  
  389. #ifdef ds3100
  390.     printf("Unix system call #%d not implemented yet.\n", sysCallNum);
  391. #endif
  392.     Proc_Exit(1);
  393.     return -1;
  394. }
  395.  
  396. static int
  397. Sys_TestStub(arg0, arg1, arg2, arg3, arg4, arg5)
  398.     int arg0;
  399.     int arg1;
  400.     int arg2;
  401.     int arg3;
  402.     int arg4;
  403.     int arg5;
  404. {
  405.  
  406.     printf("Sys_TestStub(%x, %x, %x, %x, %x, %x)\n",
  407.     arg0, arg1, arg2, arg3, arg4, arg5);
  408.     return 9999;
  409. }
  410.  
  411.